N = 1 (slider from 1 to 15, step 1)
f(x) = If[(-π) < x < π, x^(2)]
g(x) = If[π < x < (2 * π), (x - (2 * π))^(2)]
h(x) = If[(-2 * π) < x < (-π), (x + (2 * π))^(2)]
S = Sum(((-1)^(n) / n^(2) * cos((n * x))), n, 1, N)
p(x) = If[-6.283185307179586 < x < 6.283185307179586, π^(2) / 3 + (4 * S(x))]